package org.ovirt.microvirt.services.situation.lom.impl;

import java.io.IOException;

import javax.ws.rs.FormParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;

import com.jcraft.jsch.JSch;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;

@Path("/utils/wal")
public class WalServiceHelper {

	@POST
	@Path("/resolveMac")
	public String resolveMac(@FormParam("addr") String address, @FormParam("pwd") String rootPwd) throws IOException {
		//now this is really dummy
		try {
			JSch jSch = new JSch();
			Session session = jSch.getSession("root", address);
			session.setPassword(rootPwd);
			session.connect(1000);
		} catch (JSchException e) {
			throw new IOException(e);
		}
		return "";
	}

	

}
